<div class="content-list">
    
    <h2><?php echo $this->titulo;?></h2>
    
    <table id="tlist">
        <thead>
            <tr>
                <th>Nome</th>
                <th width="80px">Turno</th>
                <th>Turma</th>
                <th width="50px">Ano</th>
                <th width="50px">Semestre</th>
                <th width="80px"> Matrículas </th>
                <th class="bc">&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->result as $row) {
                
                $obj = new Admin_Model_DbTable_Curso();
                $cur = $obj->fetchRow('CUR_ID = ' . $row['CUR_ID'])->toArray();
                
                $obj = new Admin_Model_DbTable_Filamatricula();
                $fil = $obj->fetchAll($obj->select()->from('FILA_MATRICULA', array(new Zend_Db_Expr("COUNT(*) AS TOTAL")))->where('CUR_ID = ' . $row['CUR_ID']))->toArray();

            ?>
                <tr>  
                    <td align="left"><?php echo $cur['CUR_NOM']; ?></td>
                    <td align="left"><?php echo dominio::getTurno($cur['TUR_ID']); ?></td>
                    <td align="left"><?php echo $cur['CUR_TRM']; ?></td>
                    <td align="left"><?php echo $cur['CUR_ANO']; ?></td>
                    <td align="left"><?php echo dominio::getSemestres($cur['CUR_SEM']); ?></td>
                    <td><?php echo $fil[0]['TOTAL']; ?></td>
                    <td class="bc">
                        <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'novocurso', 'id' => $row->CUR_ID)); ?>">Criar Turma</a><?php }?>
                        <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'matriculas', 'cur_id' => $row->CUR_ID)); ?>">Em espera</a><?php }?>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>